<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>pv详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
    <script src="/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
    <script src="/js/xkube.js?v=1" charset="utf-8"></script>

</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
                  <button class="layui-btn" id="EditYamlBtn">yaml编辑</button>
                  <!-- <button class="layui-btn layui-btn-danger" id="DelBtn">删除</button> -->
                  <br><br>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                <legend>元数据</legend>
            </fieldset>  
              <blockquote class="layui-elem-quote layui-quote-nm">
                  <table class="layui-table" lay-even="" lay-size="lm">
                    <colgroup>
                      <col width="150">
                      <col width="400">
                      <col width="150">
                      <col>
                    </colgroup>
                    <tbody>
                      <tr>
                        <td>名称:</td>
                        <td><div id="appNameTitle"></div></td>
                        <td>标签:</td>
                        <td><div id="labels"></div></td>
                      </tr>
                      <tr>
                        <td>创建时间:</td>
                        <td><div id="createTime"></div></td>
                        <td>注解:</td>
                        <td><div id="annotations"></div></td>
                      </tr>
                    </tbody>
                  </table> 
              </blockquote> 

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend>资源信息</legend>
            </fieldset>
                  <table class="layui-table" lay-even="" lay-size="lm">
                    <colgroup>
                      <col width="150">
                      <col width="400">
                      <col width="150">
                      <col>
                    </colgroup>
                    <tbody>
                      <tr>
                        <td>提供者:</td>
                        <td><div id="provisioner"></div></td>
                        <td>回收策略:</td>
                        <td><div id="reclaimPolicy"></div></td>
                      </tr>
                      <tr>
                        <td>参数:</td>
                        <td><div id="parameters"></div></td>
                        <td></td>
                        <td></td>
                      </tr>
                    </tbody>
                  </table> 
    </div>
</div>
</body>
<script>
    layui.use(['form', 'table','miniTab'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
            miniTab = layui.miniTab,
            miniTab.listen();

        var storageclassName = getQueryString("storageclassName");
        $('#appNameTitle').html(storageclassName);

        $('#DelBtn').on("click",function(){
            layer.confirm('确定删除'+storageclassName+'?', {icon: 3, title:'提示',yes: function(index){
        			  $.ajax({
        			   url: "/xkube/storageclass/v1/Del"+location.search,
        			   type: "GET",
                 data: JSON.stringify(bodystr),
                 dataType: "json",
        			   success: function (resp) {
        					  if (resp.code == 0 ) {
                      layer.msg('删除成功', {icon: 1});
                    }else{
                      layer.msg(resp.msg,{icon:2});
                    }
        				  }
        		    });
              },
              cancel: function(index, layero){ 
                    layer.close(index);
              } 
            });
        });

        $('#EditYamlBtn').on("click",function(){
                layer.open({
                    title: 'yaml',
                    type: 2,
                    shade: 0.2,
                    maxmin:true,
                    shadeClose: true,
                    area: ['45%', '92%'],
                    content: '/page/xkube/storageclassYaml.html'+location.search,
                });
        });

        //detai详细
        $.get('/xkube/storageclass/v1/Detail' + location.search, function (resp) {
  				  if (resp.storageclassName != '' ) {
                //console.log(resp);
                //详细信息
                var storageclassName = resp.storageclassName;
                $('#storageclassName').html(storageclassName);
  
                var annotations = resp.annotations;
                $('#annotations').html(annotations);

                var labels = resp.labels;
                $('#labels').html(labels);

                var createTime = resp.createTime;
                $('#createTime').html(createTime);
  
                var provisioner = resp.provisioner;
                $('#provisioner').html(provisioner);

                var reclaimPolicy = resp.reclaimPolicy;
                $('#reclaimPolicy').html(reclaimPolicy);

                var parameters = resp.parameters;
                $('#parameters').html(parameters);
            }else{
              layer.msg('请重新刷新',{icon:2});
            }
		    });
    });
</script>
</html>